1. Field of the Invention
The present invention is related to an encoding method for recording data on a compact disk (CD), and more particularly, to an encoding method that can efficiently upgrade the data encoding performance when an optical recording system records gap regions or sectors including repeated data onto a compact disk.
2. Background of the Invention
Recently, optical Optical disks have become an important and popular storage media for holding a huge volume of data. Generally, the data that is ready to be recorded onto a compact disk is divided and encoded into a plurality of sectors by following standard formats such as the sector structures shown in FIGS. 1 to 3. In these figures, the unit of data is byte, and there are 2352 bytes included in a sector. FIG. 1 is a schematic diagram of the first encoding form (e.g., mode 1 standard), which is adapted to encode data for application software. FIGS. 2 and 3 respectively show the second encoding form (e.g., mode 2 form 1 standard) and the third encoding form (e.g., mode 2 form 2 standard) that both of them are adapted for encoding video/audio data.
The conventional encoding method is described by making reference with FIG. 1. A host such as a personal computer (PC) firstly transfers a user data 13 having 2048 bytes to an optical recording system, e.g. a compact disk-recordable (CD-R) drive or a compact disk-rewritable (CD-RW) drive. The optical recording system then generates a synchronous code 11 and a header 12 for the user data 13, while an error detection code 14 (EDC) is generated according to the synchronous code 11, header 12, and the user data 13. Sequentially, after a zero code 15 is attached (with 4-byte length), an error correction code 16 (ECC) is next generated according to the header 12, user data 13, EDC 14, and the zero code 15. The first encoding form (or the C3 encoding procedure) is completed when the above encoding procedure terminates, wherein the ECC 16 includes a P code 161 (P-parity check code) and a Q code 162 (Q-parity check code). Sequential encoding procedures, including C2 and C1 encoding procedures, are then performed to the complete encoded data under the mode 1 standard.
Sometimes the optical recording system will record so-called gap regions on the compact disk within the data recording procedures. For example, when an audio or music CD is recording, the optical recording system may record a lot of gap regions (e.g., 2 seconds, about 150 gap regions) adjacent to a just recorded song before recording another one. Besides, if the so-called buffer-under-run occurs during data recoding operations, the optical recording system will also record gap regions on the current compact disk and wait for the data stored in buffers reaches to a predetermined threshold again. In comparison with a normal sector, these gap regions usually contain repeated information (e.g., all bit 0's) stored therein, and contents of the gap regions will be repeated except the header 12, 22 and 32, the EDC 14, 25 and 35, and the ECC 16 and 22.
As shown in FIG. 1, when a sector is being encoded, the ECC 16 will be generated according the header 12, user data 13, EDC 14 and zero code 15, while the ECC 26 will be derived according to the user data 24 and EDC 25 as shown in FIG. 2. However, since the the user data 13, 24 and 34 occupy most of the entire sector portions and they usually store repeated data as mentioned above, the conventional approach is obvious an inefficient way for encoding information due to a time-cost as well as resource-costapproach is employed for the optical recording system.
Accordingly, the aforementioned conventional encoding scheme obviously includes many disadvantages waiting for further improvements. The present invention therefore discloses a solution for overcoming these disadvantages of the prior art scheme.